package com.eascs.web.demo.include;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.site.view.ViewContext;
import com.eascs.web.demo.view.DefaultMasterViewController;

@Controller
public class IncludeSampleViewController extends DefaultMasterViewController {
	private final Logger logger = LoggerFactory.getLogger(IncludeSampleViewController.class);

	@RequestMapping(value = "/sample/include/", method = RequestMethod.GET)
	public String include() {
		return "/sample/include/index";
	}

	@Override
	public void preHandle() {
		ViewContext.put("k2", "v2");
		logger.debug("preHandle(..)");
	}

	@Override
	public void afterCompletion() {
		ViewContext.put("k3", "v3");
		logger.debug("afterCompletion(..)");
	}

}
